<% queues.each do |queue| -%>
resource "aws_sqs_queue" "<%= module_name_of(queue) %>" {
    name                       = "<%= module_name_of(queue) %>"
    visibility_timeout_seconds = <%= queue["VisibilityTimeout"] %>
    message_retention_seconds  = <%= queue["MessageRetentionPeriod"] %>
    max_message_size           = <%= queue["MaximumMessageSize"] %>
    delay_seconds              = <%= queue["DelaySeconds"] %>
    receive_wait_time_seconds  = <%= queue["ReceiveMessageWaitTimeSeconds"] %>
<% if queue.key? "Policy" -%>
    policy                     = <<POLICY
<%= prettify_policy(queue["Policy"], unescape: true) %>
POLICY
<% end -%>
<% if queue.key? "RedrivePolicy" -%>
    redrive_policy             = <<POLICY
<%= prettify_policy(queue["RedrivePolicy"], unescape: true) %>
POLICY
<% end -%>
}

<% end -%>
